# import pandas as pd
# person={
# "name":['Google','Runoob','Runoob','Runoob','Taobao'],
# "age":[50,40,40,90,23]
# }
# df = pd.DataFrame(person)
# print(df.duplicated())

# person={
#     "name":['张三','李四','王五','李四'],
#     "age":[20,21,122,21],
#     "gender":['男','女','男','女'],
# }
# df=pd.DataFrame(person)
# print(df)
# # for x in df.index:
# #     if df.loc[x,'age']>df['age'].mean():
# #         y=df['age'].mean()
# #         df.loc[x,'age']=y
# # print(df.to_string())
# #获取重复值
# print(df.duplicated())
# #删除重复值
# df.drop_duplicates(inplace=True)
# print(df.to_string())

# import requests
# base_url="https://uapis.cn/api/v1/misc/weather"
# url=base_url+"?city=资阳&adcode=510510"
# resp=requests.get(
# url=url,
# )
# print(resp.json())
# print(resp.json()["weather"])

# import requests
# base_url="https://uapis.cn/api/v1/misc/phoneinfo"
# url=base_url+"?phone=15583932537"
# resp=requests.get(url)
# print(resp.json())

# from openai import OpenAI
#
# client = OpenAI(
#     api_key="sk-qvfxtzupocgispedsgnaotuzttsfqzmxdrfewbnprzdmdyhb",
#     base_url="https://api.siliconflow.cn/v1"
# )
#
# question = input("请输入您的问题：")
#
# response = client.chat.completions.create(
#     model="deepseek-ai/DeepSeek-V3",
#     messages=[
#         {"role": "system", "content": "你是一位幽默大师"},
#         {"role": "user", "content": question}
#     ],
#     temperature=0.7,
#     max_tokens=1024,
#     stream=True
# )
#
# # 逐步接收并处理响应
# for chunk in response:
#     if not chunk.choices:
#         continue
#     if chunk.choices[0].delta.content:
#         print(chunk.choices[0].delta.content, end="", flush=True)
#     if hasattr(chunk.choices[0].delta, 'reasoning_content') and chunk.choices[0].delta.reasoning_content:  # 修正：数字0
#         print(chunk.choices[0].delta.reasoning_content, end="", flush=True)

# from http import HTTPStatus
# from urllib.parse import urlparse, unquote
# from pathlib import PurePosixPath
# import requests
# from dashscope import ImageSynthesis
# import os
#
# prompt = fr"一个玩滑板的红衣服黄头发的男生"
#
# # 请用百炼API Key
# api_key = ""
# print('---同步调用，请等待任务执行---')
# rsp = ImageSynthesis.call(api_key=api_key,
#     model="qwen-image",
#     prompt=prompt,
#     n=1,
#     size='1328*1328',
#     prompt_extend=True,
#     watermark=True)
#
# print('response: %s' % rsp)
# if rsp.status_code == HTTPStatus.OK:
#     # 在当前目录下保存图片
#     for result in rsp.output.results:
#         file_name = PurePosixPath(unquote(urlparse(result.url).path)).parts[-1]
#         with open('./data/draw/%s' % file_name, 'wb+') as f:
#             f.write(requests.get(result.url).content)
#
# else:
#     print('同步调用失败，status_code: %s, code: %s, message: %s' %
#         (rsp.status_code, rsp.code, rsp.message))

# import matplotlib.pyplot as plt
# import numpy as np
# xpoints =np.array([0,6])
# ypoints =np.array([0,200])
# plt.plot(xpoints,ypoints)
# plt.show()

# import matplotlib.pyplot as plt
# import numpy as np
# xpoints=np.array([1,8])
# ypoints=np.array([3,10])
# plt.plot(xpoints,ypoints,'o')
# plt.show()

# import matplotlib.pyplot as plt
# import numpy as np
# xpoints=np.array([1,2,6,8])
# ypoints =np.array([3,8,1,10])
# plt.plot(xpoints,ypoints)
# plt.show()

# import matplotlib.pyplot as plt
# import numpy as np
# x = np.arange(0,4*np.pi,0.1)
# #_start,stop,step
# y =np.sin(x)
# Z = np.cos(x)
# plt.plot(x,y,x,Z)
# plt.show()

# import pandas as pd
# import matplotlib.pyplot as plt
# df = pd.read_excel('', engine='openpyxl')
# print("数据列名:", df.columns.tolist())
# print("前5行数据:")
# print(df.head())
# x_column = '日期'
# y_column = '销售额'
# plt.figure(figsize=(10, 6))
# plt.plot(df[x_column], df[y_column], marker='o', linestyle='-', color='blue', linewidth=2, markersize=6)
# plt.xlabel(x_column, fontsize=12)
# plt.ylabel(y_column, fontsize=12)
# plt.title(f'{y_column}随时间变化趋势', fontsize=14, fontweight='bold')
# plt.grid(True, linestyle='--', alpha=0.7)
# plt.xticks(rotation=45)
# plt.tight_layout()
# plt.show()

# import matplotlib.pyplot as plt
#
# plt.rcParams['font.sans-serif'] = ['SimHei']
# plt.rcParams['axes.unicode_minus'] = False
#
# labels = ['1月8', '2月12', '3月10', '4月9', '5月11', '6月15', '7月18', '8月16', '9月13', '10月14', '11月17', '12月20']
# sales = [8, 12, 10, 9, 11, 15, 18, 16, 13, 14, 17, 20]
#
# plt.plot(labels, sales, color='blue', linewidth=1, markersize=2, marker='o')
#
#
# plt.title('2024年奶茶店月度销售额趋势图')
# plt.xlabel('月份')
# plt.ylabel('销售额')
#
# plt.show()

# import matplotlib.pyplot as plt
#
# plt.rcParams["font.family"] = ["SimHei", "WenQuanYi Micro Hei", "Heiti TC"]
# plt.rcParams["axes.unicode_minus"] = False
#
# months = ["1月", "2月", "3月", "4月", "5月", "6月",
#           "7月", "8月", "9月", "10月", "11月", "12月"]
# sales = [8, 12, 10, 9, 11, 15, 18, 16, 13, 14, 17, 20]
#
# plt.figure(figsize=(10, 6))
#
# plt.plot(months, sales, color='red', marker='o', linestyle='-', linewidth=2, markersize=5)
#
# for x, y in zip(months, sales):
#     plt.text(x, y + 0.5, f'{y}', ha='center', fontsize=10)
#
# plt.title("2024 年奶茶店月度销售额趋势图", fontsize=15, pad=20)
# plt.xlabel("月份", fontsize=12, labelpad=10)
# plt.ylabel("销售额（万元）", fontsize=12, labelpad=10)
#
# plt.tight_layout()
# plt.show()